import CodeBlock from "@theme/CodeBlock";

import RandomNumbers from "!!raw-loader!./07.random-numbers.zig";
import RandomNumbersCrypto from "!!raw-loader!./07.random-numbers-crypto.zig";

# Random Numbers

Here, we create a new prng using a 64-bit random seed. a, b, c, and d are given
random values via this prng. The expressions giving c and d values are
equivalent. `DefaultPrng` is `Xoroshiro128`; there are other prngs available in
`std.Random`.

<CodeBlock language="zig">{RandomNumbers}</CodeBlock>

Cryptographically secure random is also available.

<CodeBlock language="zig">{RandomNumbersCrypto}</CodeBlock>

:::info
We can now use our knowledge of `std.Random` and [make a guessing game together](/posts/a-guessing-game).

:::
